using System;
using System.Collections.Generic;
using Iesi.Collections.Generic;
using NHibernate.Mapping.Attributes;
using NHMA = NHibernate.Mapping.Attributes;

namespace SuperMarketManagement.Entity
{

    [Class(Name = "Customer")]
    public class Customer
    {
        [Id(1, Name = "AutoId"), Generator(2, Class = "native")]
        public virtual long AutoId { get; set; }
        [Property]
        public virtual string Name { get; set; }
        [Property]
        public virtual string PersonalId { get; set; }
        [Property]
        public virtual int AcccumulatedPoint { get; set; }
        [Property]
        public virtual string Cellphone { get; set; }
        [Property]
        public virtual DateTime CreatedDate { get; set; }
        [Property]
        public virtual bool SecurityEnabled { get; set; }
        [Property]
        public virtual string Password { get; set; }


        //[NHMA.Set(1, Cascade = "none")]
        //[NHMA.Key(2, Column = "CustomerAutoId")]
        //[NHMA.OneToMany(4, ClassType = typeof(Invoice))]
        //public virtual Set<Invoice> Invoices { get; set; }

        public Customer()
        {
            //Invoices = new HashedSet<Invoice>();
        }


        public Customer(String name, String personalId, int acccumulatedPoint, String cellphone, DateTime createdDate, bool securityEnabled, String password)
            : this()
        {
            Name = name;
            PersonalId = personalId;
            AcccumulatedPoint = acccumulatedPoint;
            Cellphone = cellphone;
            CreatedDate = createdDate;
            SecurityEnabled = securityEnabled;
            Password = password;
        }

    }
}